package com.qys.livesMall.finance.model.dto;

import com.qys.livesMall.finance.enums.AccountTradeTypeEnum;
import com.qys.livesMall.finance.enums.AccountTypeEnum;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @menu AccountInfo
 * @date 2023/07/28 18:11
 */
@Data
@Accessors(chain = true)
public class AccountInfo {

    /**
     * 账户类型
     */
    private AccountTypeEnum accountType;
    /**
     * 用户id
     * 账户类型是USER_ACCOUNT和SHOP_ACCOUNT时必填
     */
    private Long userId;
    /**
     * 店铺id
     * 账户类型是SHOP_ACCOUNT时必填
     */
    private Long shopId;

    public static AccountInfo build(AccountTypeEnum accountType){
        AccountInfo info=new AccountInfo()
                .setAccountType(accountType);
        return info;

    }

    public static AccountInfo build(AccountTypeEnum accountType,Long userId){
        AccountInfo info=new AccountInfo()
                .setAccountType(accountType)
                .setUserId(userId);
        return info;

    }

    public static AccountInfo build(AccountTypeEnum accountType,Long userId,Long shopId){
        AccountInfo info=new AccountInfo()
                .setAccountType(accountType)
                .setUserId(userId)
                .setShopId(shopId);
        return info;

    }
}

